import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 */
public class Text3 {
    public static void rotate(int[] nums, int k) {
        int cout=nums.length;
        for(int i=0;i<k;i++){
            int tmp =nums[cout-1];
            for(int j =cout-1;j>0;j--){
                nums[j]=nums[j-1];
            }
            nums[0]=tmp;
        }
        System.out.println(Arrays.toString(nums));
    }
    public static int missingNumber(int[] nums) {
        int num =nums.length;
        for(int i=0;i <nums.length;i++){
            num ^= i^nums[i];
            System.out.println();
        }
        return num;

    }
    public static void main(String[] args) {
       int[] array =new int[]{1,2,3,4,5,6,7};
        //System.out.println(missingNumber(array));
        rotate(array,3);

    }
}
